from tensorflow.keras import layers, optimizers, datasets  # 导入 TF 子库等
from tensorflow import keras  # 导入 TF 子库 keras
import tensorflow as tf  # 导入 TF 库

if __name__ == '__main__':
    layers.Dense(256,activation='relu')
    model=keras.Sequential([ # 3 个非线性层的嵌套模型
        layers.Dense(256,activation='relu'),# 隐藏层 1
        layers.Dense(128,activation='relu'),# 隐藏层 2
        layers.Dense(10)# 输出层，输出节点数为 10
    ])
    with tf.GradientTape() as tape:
        x=tf.reshape(x,(-1,28*28))

